home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / man.n / tclvars.n < prev    next >
Text File  |  1995-07-17  |  10KB  |  338 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/tclvars.n,v 1.1 93/06/16 16:52:49 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .\" The definitions below are for supplemental macros used in Tcl/Tk
  24. .\" manual entries.
  25. .\"
  26. .\" .HS name section [date [version]]
  27. .\"    Replacement for .TH in other man pages.  See below for valid
  28. .\"    section names.
  29. .\"
  30. .\" .AP type name in/out [indent]
  31. .\"    Start paragraph describing an argument to a library procedure.
  32. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  33. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  34. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  35. .\"    needed;  use .AS below instead)
  36. .\"
  37. .\" .AS [type [name]]
  38. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  39. .\"    name are examples of largest possible arguments that will be passed
  40. .\"    to .AP later.  If args are omitted, default tab stops are used.
  41. .\"
  42. .\" .BS
  43. .\"    Start box enclosure.  From here until next .BE, everything will be
  44. .\"    enclosed in one large box.
  45. .\"
  46. .\" .BE
  47. .\"    End of box enclosure.
  48. .\"
  49. .\" .VS
  50. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  51. .\"    of man pages.
  52. .\"
  53. .\" .VE
  54. .\"    End of vertical sidebar.
  55. .\"
  56. .\" .DS
  57. .\"    Begin an indented unfilled display.
  58. .\"
  59. .\" .DE
  60. .\"    End of indented unfilled display.
  61. .\"
  62. '\"    # Heading for Tcl/Tk man pages
  63. .de HS
  64. .ds ^3 \\0
  65. .if !"\\$3"" .ds ^3 \\$3
  66. .if '\\$2'cmds'       .TH \\$1 1 \\*(^3 \\$4
  67. .if '\\$2'lib'        .TH \\$1 3 \\*(^3 \\$4
  68. .if '\\$2'tcl'        .TH \\$1 n \\*(^3 Tcl "Tcl Built-In Commands"
  69. .if '\\$2'tk'         .TH \\$1 n \\*(^3 Tk "Tk Commands"
  70. .if '\\$2'tclc'        .TH \\$1 3 \\*(^3 Tcl "Tcl Library Procedures"
  71. .if '\\$2'tkc'         .TH \\$1 3 \\*(^3 Tk "Tk Library Procedures"
  72. .if '\\$2'tclcmds'         .TH \\$1 1 \\*(^3 Tk "Tcl Applications"
  73. .if '\\$2'tkcmds'         .TH \\$1 1 \\*(^3 Tk "Tk Applications"
  74. .if t .wh -1.3i ^B
  75. .nr ^l \\n(.l
  76. .ad b
  77. ..
  78. '\"    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. ..
  100. '\"    # define tabbing values for .AP
  101. .de AS
  102. .nr )A 10n
  103. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  104. .nr )B \\n()Au+15n
  105. .\"
  106. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  107. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  108. ..
  109. '\"    # BS - start boxed text
  110. '\"    # ^y = starting y location
  111. '\"    # ^b = 1
  112. .de BS
  113. .br
  114. .mk ^y
  115. .nr ^b 1u
  116. .if n .nf
  117. .if n .ti 0
  118. .if n \l'\\n(.lu\(ul'
  119. .if n .fi
  120. ..
  121. '\"    # BE - end boxed text (draw box now)
  122. .de BE
  123. .nf
  124. .ti 0
  125. .mk ^t
  126. .ie n \l'\\n(^lu\(ul'
  127. .el \{\
  128. .\"    Draw four-sided box normally, but don't draw top of
  129. .\"    box if the box started on an earlier page.
  130. .ie !\\n(^b-1 \{\
  131. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  132. .\}
  133. .el \}\
  134. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  135. .\}
  136. .\}
  137. .fi
  138. .br
  139. .nr ^b 0
  140. ..
  141. '\"    # VS - start vertical sidebar
  142. '\"    # ^Y = starting y location
  143. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  144. .de VS
  145. .mk ^Y
  146. .ie n 'mc \s12\(br\s0
  147. .el .nr ^v 1u
  148. ..
  149. '\"    # VE - end of vertical sidebar
  150. .de VE
  151. .ie n 'mc
  152. .el \{\
  153. .ev 2
  154. .nf
  155. .ti 0
  156. .mk ^t
  157. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  158. .sp -1
  159. .fi
  160. .ev
  161. .\}
  162. .nr ^v 0
  163. ..
  164. '\"    # Special macro to handle page bottom:  finish off current
  165. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  166. '\"    # page bottom macro.
  167. .de ^B
  168. .ev 2
  169. 'ti 0
  170. 'nf
  171. .mk ^t
  172. .if \\n(^b \{\
  173. .\"    Draw three-sided box if this is the box's first page,
  174. .\"    draw two sides but no top otherwise.
  175. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  176. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  177. .\}
  178. .if \\n(^v \{\
  179. .nr ^x \\n(^tu+1v-\\n(^Yu
  180. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  181. .\}
  182. .bp
  183. 'fi
  184. .ev
  185. .if \\n(^b \{\
  186. .mk ^y
  187. .nr ^b 2
  188. .\}
  189. .if \\n(^v \{\
  190. .mk ^Y
  191. .\}
  192. ..
  193. '\"    # DS - begin display
  194. .de DS
  195. .RS
  196. .nf
  197. .sp
  198. ..
  199. '\"    # DE - end display
  200. .de DE
  201. .fi
  202. .RE
  203. .sp .5
  204. ..
  205. .HS tclvars tcl
  206. .BS
  207. '\" Note:  do not modify the .SH NAME line immediately below!
  208. .SH NAME
  209. tclvars \- Variables used by Tcl
  210. .BE
  211.  
  212. .SH DESCRIPTION
  213. .PP
  214. The following global variables are created and managed automatically
  215. by the Tcl library.  Except where noted below, these variables should
  216. normally be treated as read-only by application-specific code and by users.
  217. .TP
  218. \fBenv\fR
  219. .br
  220. This variable is maintained by Tcl as an array
  221. whose elements are the environment variables for the process.
  222. Reading an element will return the value of the corresponding
  223. environment variable.
  224. Setting an element of the array will modify the corresponding
  225. environment variable or create a new one if it doesn't already
  226. exist.
  227. Unsetting an element of \fBenv\fR will remove the corresponding
  228. environment variable.
  229. Changes to the \fBenv\fR array will affect the environment
  230. passed to children by commands like \fBexec\fR.
  231. If the entire \fBenv\fR array is unset then Tcl will stop
  232. monitoring \fBenv\fR accesses and will not update environment
  233. variables.
  234. .TP
  235. \fBerrorCode\fR
  236. After an error has occurred, this variable will be set to hold
  237. additional information about the error in a form that is easy
  238. to process with programs.
  239. \fBerrorCode\fR consists of a Tcl list with one or more elements.
  240. The first element of the list identifies a general class of
  241. errors, and determines the format of the rest of the list.
  242. The following formats for \fBerrorCode\fR are used by the
  243. Tcl core; individual applications may define additional formats.
  244. .RS
  245. .TP
  246. \fBARITH\fI code msg\fR
  247. .VS
  248. This format is used when an arithmetic error occurs (e.g. an attempt
  249. to divide by zero in the \fBexpr\fR command).
  250. \fICode\fR identifies the precise error and \fImsg\fR provides a
  251. human-readable description of the error.  \fICode\fR will be either
  252. DIVZERO (for an attempt to divide by zero),
  253. DOMAIN (if an argument is outside the domain of a function, such as acos(\-3)),
  254. IOVERFLOW (for integer overflow),
  255. OVERLFLOW (for a floating-point overflow),
  256. or UNKNOWN (if the cause of the error cannot be determined).
  257. .VE
  258. .TP
  259. \fBCHILDKILLED\fI pid sigName msg\fR
  260. This format is used when a child process has been killed because of
  261. a signal.  The second element of \fBerrorCode\fR will be the
  262. process's identifier (in decimal).
  263. The third element will be the symbolic name of the signal that caused
  264. the process to terminate; it will be one of the names from the
  265. include file signal.h, such as \fBSIGPIPE\fR.
  266. The fourth element will be a short human-readable message
  267. describing the signal, such as ``write on pipe with no readers''
  268. for \fBSIGPIPE\fR.
  269. .TP
  270. \fBCHILDSTATUS\fI pid code\fR
  271. This format is used when a child process has exited with a non-zero
  272. exit status.  The second element of \fBerrorCode\fR will be the
  273. process's identifier (in decimal) and the third element will be the exit
  274. code returned by the process (also in decimal).
  275. .TP
  276. \fBCHILDSUSP\fI pid sigName msg\fR
  277. This format is used when a child process has been suspended because
  278. of a signal.
  279. The second element of \fBerrorCode\fR will be the process's identifier,
  280. in decimal.
  281. The third element will be the symbolic name of the signal that caused
  282. the process to suspend; this will be one of the names from the
  283. include file signal.h, such as \fBSIGTTIN\fR.
  284. The fourth element will be a short human-readable message
  285. describing the signal, such as ``background tty read''
  286. for \fBSIGTTIN\fR.
  287. .TP
  288. \fBNONE\fR
  289. .br
  290. This format is used for errors where no additional information is
  291. available for an error besides the message returned with the
  292. error.  In these cases \fBerrorCode\fR will consist of a list
  293. containing a single element whose contents are \fBNONE\fR.
  294. .TP
  295. \fBPOSIX \fIerrName msg\fR
  296. .VS
  297. If the first element of \fBerrorCode\fR is \fBPOSIX\fR, then
  298. the error occurred during a POSIX kernel call.
  299. .VE
  300. The second element of the list will contain the symbolic name
  301. of the error that occurred, such as \fBENOENT\fR; this will
  302. be one of the values defined in the include file errno.h.
  303. The third element of the list will be a human-readable
  304. message corresponding to \fIerrName\fR, such as
  305. ``no such file or directory'' for the \fBENOENT\fR case.
  306. .PP
  307. To set \fBerrorCode\fR, applications should use library
  308. procedures such as \fBTcl_SetErrorCode\fR and
  309. .VS
  310. \fBTcl_PosixError\fR,
  311. .VE
  312. or they may invoke the \fBerror\fR command.
  313. If one of these methods hasn't been used, then the Tcl
  314. interpreter will reset the variable to \fBNONE\fR after
  315. the next error.
  316. .RE
  317. .TP
  318. \fBerrorInfo\fR
  319. After an error has occurred, this string will contain one or more lines
  320. identifying the Tcl commands and procedures that were being executed
  321. when the most recent error occurred.
  322. Its contents take the form of a stack trace showing the various
  323. nested Tcl commands that had been invoked at the time of the error.
  324. .TP
  325. \fBtcl_precision\fR
  326. .VS
  327. If this variable is set, it must contain a decimal number giving the
  328. number of significant digits to include when converting floating-point
  329. values to strings.
  330. If this variable is not set then 6 digits are included.
  331. 17 digits is ``perfect'' for IEEE floating-point in that it allows
  332. double-precision values to be converted to strings and back to
  333. binary with no loss of precision.
  334. .VE
  335.  
  336. .SH KEYWORDS
  337. arithmetic, error, environment, POSIX, precision, subprocess, variables
  338.